/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package transervfx.Dato.Entidad;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;

/**
 * Representa un medio de pago con el cual se puede saldar una factura.
 */

@Entity
@Inheritance(strategy=InheritanceType.JOINED)
public abstract class MedioDePago implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    protected Float importe;

    public MedioDePago() {
    }

    public Float getImporte() {
        return importe;
    }

    public void setImporte(Float importe) {
        this.importe = importe;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) id;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof MedioDePago)) {
            return false;
        }
        MedioDePago other = (MedioDePago) object;
        if (this.id != other.id) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Dato.Entidad.MedioDePago[id=" + id + "]";
    }

}
